// import Vue from "vue";
// Vue.directive("imgerror", {
//   inserted(el, binding) {
//     console.log(el);
//     console.log(binding);
//     el.onerror = function () {
//       this.src = binding.value;
//     };
//   },
// });

export const imgerror = {
  inserted(el, binding) {
    console.log(el);
    console.log(binding);
    el.onerror = function () {
      this.src = binding.value;
    };
  },
  componentUpdated(el, options) {
    el.src = el.src || options.value;
  },
};
